package cli

import (
	"blockchain.com/part_5/block"
	"blockchain.com/part_5/wallet"
	"log"
	"fmt"
)

// 创建区块链命令行
func (cli *CLI)CreateBlockchain(address string)  {
	if !wallet.ValidateAddress(address) {
		log.Panic("ERROR: Address is not valid.")
	}

	bc := block.CreateBlockchain(address)
	bc.Db.Close()
	fmt.Println("Done!")
}